﻿@model IEnumerable<Sysgeprava.Entities.MEDICAMENTO>
@using GridMvc.Html


    <link href="@Url.Content("~/Content/Gridmvc.css")" rel="stylesheet" />
    <link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" />
    <script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")"></script>
    <script src="@Url.Content("~/Scripts/gridmvc.min.js")"></script>

@{
    ViewBag.Title = "MEDICAMENTO";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="float-center" id="panel_titulo">
   <img src="~/Images/titulos/medicamento.png" alt="medicamento" height="70" width="400"/>
</div>

<h2></h2>

@*@using (Html.BeginForm())
{
    <fieldset>
        <legend>Buscar Medicamento</legend>
        <b>Criterio:</b>
        @Html.TextBox("criterio")
        <button type="submit" name="btnBuscar" value="Buscar"><img src="~/Images/botones/search.png"></button>
    </fieldset> 
}*@

<div style="width:450px;">
    @helper Acciones(int id)
        {
         <a href="@Url.Action("Edit", "Medicamento", new { Id = id })" >
            <img src="@Url.Content("~/Images/edit.png")" title="Editar" /></a> 
         <a href="@Url.Action("Delete", "Medicamento", new { Id = id })" >
            <img src="@Url.Content("~/Images/delete.png")" title="Eliminar" /></a> 
        }

    @Html.Grid(Model).Columns(columns =>
        {
            columns.Add(pee => pee.Descripcion).Titled("Descripción").Filterable(true).SetWidth(330);
            columns.Add(pee => pee.MARCA.Descripcion).Titled("Marca").Filterable(true).SetWidth(330);
            columns.Add(o => o.Id)
                .Titled("Acciones")
                .Sanitized(false)
                .Encoded(false)
                .RenderValueAs(o => Acciones(o.Id).ToHtmlString());
        }).WithPaging(5)

</div>

<p>
    <button onclick="location.href='@Url.Action("Create")';return false;" ><img src="~/Images/botones/file_add.png"></button>
</p>